/**
 * 2025/01/01 - 2025/12/31
 */
package com.snail.server.iam.login.controller;

import com.snail.server.iam.login.dto.LoginDTO;
import com.snail.server.iam.login.manager.LoginManager;
import com.snail.server.iam.login.vo.LoginVO;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author zgadmin
 * @date 2025/9/24 17:39
 */
@Api(tags = "登录")
@RestController
@RequestMapping("/login")
public class LoginController {

    @Resource
    LoginManager loginManager;

    @PostMapping
    public LoginVO login(LoginDTO loginDTO) {
        return loginManager.login(loginDTO);
    }

    @DeleteMapping
    public boolean logout() {
        return loginManager.logout();
    }

}